package com.tarena.lbs.basic.dao.repository.impl;

import com.tarena.lbs.basic.dao.mapper.AreaMapper;
import com.tarena.lbs.basic.dao.repository.AreaRepository;
import com.tarena.lbs.basic.pojo.po.AreaPO;
import com.tarena.lbs.basic.pojo.vo.AreaVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class AreaRepositoryImpl implements AreaRepository {
    private AreaMapper areaMapper;
    @Autowired
    public void setAreaMapper(AreaMapper areaMapper) {
        this.areaMapper = areaMapper;
    }
    public List<AreaVO> queryProvinces() {
        return areaMapper.queryProvinces();
    }

    public List<AreaVO> queryChildren(Integer parentId) {
        return areaMapper.queryChildren(parentId);
    }

    public List<AreaPO> findAll() {
        return areaMapper.selectList(null);
    }
}
